package com.bitin.module.user.domain.entity;

import com.bitin.common.constant.Gender;
import com.bitin.common.data.model.AbstractAuditModel;
import com.bitin.common.data.model.Email;
import com.bitin.common.data.model.Phone;
import jakarta.persistence.*;
import lombok.*;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * @Author: Mr.Lu
 * @Datetime 2024/8/13 22:47
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Entity
@Table(name = "employee")
public class Employee extends AbstractAuditModel {

    private String nickname;

    @Enumerated(EnumType.STRING)
    private Gender gender;

    private LocalDate birthdate;

    /**
     * 手机号码
     */
    @Embedded
    @AttributeOverrides({
            @AttributeOverride(name = "value", column = @Column(name = "mobile", unique = true, nullable = false, length = 11))
    })
    private Phone phone;
    /**
     * 电子邮件
     */
    @Embedded
    private Email email;

    private BigDecimal salary;
}
